#include "udpdata.h"
#include "tcpdata.h"
#include "string.h"
#include "timer.h"
#include "gsm.h"
#include "IAP.h"
#include "math.h"
#include "adcdeal.h"
#include "SysSet.h"
void SendUdpDate_Pro()
{
	        unsigned char sendbuf[1024]; 
          unsigned short sendlenght=0;  
	        sendlenght=0;          
          memcpy(&sendbuf[sendlenght],"ZHHB:ID=",8);
          sendlenght+=8;
	        memcpy(&sendbuf[sendlenght],id,11);
          sendlenght+=11;	      
	        memcpy(&sendbuf[sendlenght],";VER=",5);
          sendlenght+=5;
	        memcpy(&sendbuf[sendlenght],VER,3);
          sendlenght+=3;        
	        memcpy(&sendbuf[sendlenght],";TEMP=",6);
          sendlenght+=6;
	        sendbuf[sendlenght++]=TEMP/100+0x30;
          sendbuf[sendlenght++]=TEMP%100/10+0x30;
	        sendbuf[sendlenght++]=0X2E;
          sendbuf[sendlenght++]=TEMP%10+0x30;      
				  memcpy(&sendbuf[sendlenght],";WET=",5);
          sendlenght+=5;
	        sendbuf[sendlenght++]=WET/100+0x30;
          sendbuf[sendlenght++]=WET%100/10+0x30;
	        sendbuf[sendlenght++]=0X2E;
          sendbuf[sendlenght++]=WET%10+0x30;		
					memcpy(&sendbuf[sendlenght],";GASORI=",8);
          sendlenght+=8;
					sendbuf[sendlenght++]=GasOriginal/1000+0x30;
	        sendbuf[sendlenght++]=GasOriginal%1000/100+0x30;
          sendbuf[sendlenght++]=GasOriginal%100/10+0x30;
          sendbuf[sendlenght++]=GasOriginal%10+0x30;        
					memcpy(&sendbuf[sendlenght],";GASFLOAT=",10);
          sendlenght+=10;
					sendbuf[sendlenght++]=(u16)(GasFloat*100.0)/1000+0x30;
	        sendbuf[sendlenght++]=(u16)(GasFloat*100.0)%1000/100+0x30;
          sendbuf[sendlenght++]=(u16)(GasFloat*100.0)%100/10+0x30;
          sendbuf[sendlenght++]=(u16)(GasFloat*100.0)%10+0x30; 
					if(SensorWorkStatus==1) 
					{
					memcpy(&sendbuf[sendlenght],";IAD1=",6);
          sendlenght+=6;
	        sendbuf[sendlenght++]=AD_Date1/100+0x30;
          sendbuf[sendlenght++]=AD_Date1%100/10+0x30;
          sendbuf[sendlenght++]=AD_Date1%10+0x30;
 	 
				  memcpy(&sendbuf[sendlenght],";IAD2=",6);
          sendlenght+=6;
	        sendbuf[sendlenght++]=AD_Date2/100+0x30;
          sendbuf[sendlenght++]=AD_Date2%100/10+0x30;
          sendbuf[sendlenght++]=AD_Date2%10+0x30;
          sendbuf[sendlenght++]=';'; 
					}
					else
					{
					memcpy(&sendbuf[sendlenght],";IAD1=",6);
          sendlenght+=6;
	        sendbuf[sendlenght++]=0x30;
          sendbuf[sendlenght++]=0x30;
          sendbuf[sendlenght++]=0x30;
 	 
				  memcpy(&sendbuf[sendlenght],";IAD2=",6);
          sendlenght+=6;
	        sendbuf[sendlenght++]=0x30;
          sendbuf[sendlenght++]=0x30;
          sendbuf[sendlenght++]=0x30;
          sendbuf[sendlenght++]=';'; 
					}
					memcpy(&sendbuf[sendlenght],"IP=",3);
          sendlenght+=3;
	        memcpy(&sendbuf[sendlenght], USER_Socket.IP, strlen((const char*)USER_Socket.IP));
					sendlenght += strlen((const char*)USER_Socket.IP);
	        sendbuf[sendlenght++]=';';
					
					memcpy(&sendbuf[sendlenght],"PORT=",5);
          sendlenght+=5;
	        memcpy(&sendbuf[sendlenght], USER_Socket.Port, strlen((const char*)USER_Socket.Port));
					sendlenght += strlen((const char*)USER_Socket.Port);
	        sendbuf[sendlenght++]=';';
					
					memcpy(&sendbuf[sendlenght],"SIG=",4);
          sendlenght+=4;
					sendbuf[sendlenght++]=CSQ_Num/10+0x30;
          sendbuf[sendlenght++]=CSQ_Num%10+0x30;
					sendbuf[sendlenght++]=';';
					
					memcpy(&sendbuf[sendlenght],"STATUS=",7);
          sendlenght+=7;
					sendbuf[sendlenght++]=SensorWorkStatus+0x30;
					sendbuf[sendlenght++]=';';					
					memcpy(CLOUDE_Socket.DataSendBuffer,sendbuf,sendlenght);
					CLOUDE_Socket.DataSendBufferLength=sendlenght;
}




